﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Good_Manager.aspx.cs" Inherits="Page_Good_Manager" %>

<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>
<%@ Register Assembly="Infragistics2.WebUI.Misc.v7.1, Version=7.1.20071.40, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.Misc" TagPrefix="igmisc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>商品管理！</title>
    <link href="../style/main.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript" src="../js/Goods.js"></script>
    
    <script language="javascript" type="text/javascript">
    function  IsNull()
    {
        if(document.getElementById('<%=this.txtCondition.ClientID %>').value=="")
        {
            alert("请输入查询的关键字！");
            return false;
        }
    }
    
    function Over(gridNane, cellID, objectType)
    {        
        var cell = igtbl_getCellById(cellID);
        
        if(cell && cell.Column.Key == "GoodNo")        
        {
            var FileName = cell.Row.getCellFromKey("GoodPic_Big").getValue();
            var Url = "../UpFile/Goods/" + FileName;            
                           
            document.getElementById("divDetail").innerHTML = "<img alt='暂无图片' src=" + Url + " />";            
            
            //层位置确定，显示层
            var div = document.getElementById("divDetail");  
            var X = document.body.scrollLeft + event.clientX;        
            var Y = document.body.scrollTop + event.clientY;     
            
            div.style.left = X;                                   
            div.style.top = Y;                
            div.style.display = "block";                    
        }           
    }
        
    function Out(gridNane, cellID, objectType)
    {        
        var cell = igtbl_getCellById(cellID); 
        
        if(cell && cell.Column.Key == "GoodNo")        
        {
            //隐藏层
            var div = document.getElementById("divDetail");                                    
            div.style.display = "none";
        }                   
    }                   
    
    //捕捉鼠标们位置
    function reportMove()   
    {          
        //该方法只是触发浏览器的event事件，以供JS能找到鼠标的位置      
        //var X = document.body.scrollLeft + event.clientX;        
        //var Y = document.body.scrollTop + event.clientY;                               
    } 

</script>

</head>
<body>
    <form id="form1" runat="server">
    <center>
        <table style="width: 98%; background-color: #85BDE2; vertical-align: middle;" border="0px"
            cellpadding="0px" cellspacing="1px">
            <tr>
                <td colspan="2">
                    <igmisc:WebPanel ID="WebPanel1" runat="server" Width="100%" BackColor="#DAE7F8" Expanded="False">
                        <Header Text="商品档案管理">
                            <ExpandedAppearance>
                                <Styles Font-Bold="True" Height="30px">
                                </Styles>
                            </ExpandedAppearance>
                        </Header>
                        <Template>
                            <table style="width: 100%">
                                <tr style="background-color: #DAE7F8;">
                                    <td>
                                        <asp:DropDownList ID="ddlType" runat="server">
                                            <asp:ListItem Value="GoodNo">商品编号</asp:ListItem>
                                            <asp:ListItem Value="GoodName_CN">商品名称</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:TextBox ID="txtCondition" runat="server"></asp:TextBox>
                                        <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" Width="80px"
                                            OnClientClick="return IsNull()" />
                                    </td>
                                </tr>
                            </table>
                        </Template>
                    </igmisc:WebPanel>
                </td>
            </tr>
            <tr style="background-color: #DAE7F8;">
                <td style="width: 15%; text-align: left;">
                    <div id="divScroll" style="overflow-y: auto; overflow-x: auto; width: 150px; height: 380px;">
                        <asp:TreeView ID="TVGoodType" runat="server" Width="100%" Height="380px" ImageSet="Simple"
                            OnSelectedNodeChanged="TVGoodType_SelectedNodeChanged">
                            <ParentNodeStyle Font-Bold="False" />
                            <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
                            <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px"
                                VerticalPadding="0px" />
                            <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="0px"
                                NodeSpacing="0px" VerticalPadding="0px" />
                        </asp:TreeView>
                    </div>
                </td>
                <td style="width: 85%; height: 380px;" onmouseover="reportMove()">
                    <igtbl:UltraWebGrid ID="UWGGood" runat="server" Height="350px" Width="100%" Style="left: 17px;
                        top: 0px" OnPageIndexChanged="UWGGood_PageIndexChanged">
                        <Bands>
                            <igtbl:UltraGridBand AllowUpdate="No">
                                <SelectedRowStyle BackColor="#99FF66" BorderColor="#99FF33" BorderStyle="Solid" BorderWidth="1px" />
                                <AddNewRow View="NotSet" Visible="NotSet">
                                </AddNewRow>
                                <Columns>
                                    <igtbl:UltraGridColumn BaseColumnName="ID" HeaderText="ID" Hidden="True" Key="ID">
                                        <Header Caption="ID">
                                        </Header>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="GoodNo" HeaderText="商品编号" Key="GoodNo" Width="10%">
                                        <Header Caption="商品编号">
                                            <RowLayoutColumnInfo OriginX="1" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="1" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="GoodName_CN" HeaderText="产品中文名" Key="GoodName_CN"
                                        Width="20%">
                                        <Header Caption="商品名称">
                                            <RowLayoutColumnInfo OriginX="2" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="2" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <%--<igtbl:UltraGridColumn BaseColumnName="GoodName_EN" HeaderText="产品英文名" Key="GoodName_EN">
                                            <Header Caption="产品英文名">
                                                <RowLayoutColumnInfo OriginX="3" />
                                            </Header>
                                            <Footer>
                                                <RowLayoutColumnInfo OriginX="3" />
                                            </Footer>
                                        </igtbl:UltraGridColumn>--%>
                                    <igtbl:UltraGridColumn BaseColumnName="BrandName" HeaderText="品牌" Key="BrandName"
                                        Width="10%">
                                        <Header Caption="品牌">
                                            <RowLayoutColumnInfo OriginX="4" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="4" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="Price_Orig" Width="10%" HeaderText="市场价格" Key="Price_Orig">
                                        <Header Caption="市场价格">
                                            <RowLayoutColumnInfo OriginX="5" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="5" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="Price_Vip" Width="10%" HeaderText="百企价格" Key="Price_Vip">
                                        <Header Caption="百企价格">
                                            <RowLayoutColumnInfo OriginX="6" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="6" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <%--<igtbl:UltraGridColumn BaseColumnName="Price_Lastin" EditorControlID="WebCurrencyEdit1"
                                            HeaderText="进货价" Key="Price_Lastin" Type="Custom">
                                            <Header Caption="进货价">
                                                <RowLayoutColumnInfo OriginX="7" />
                                            </Header>
                                            <Footer>
                                                <RowLayoutColumnInfo OriginX="7" />
                                            </Footer>
                                        </igtbl:UltraGridColumn>
                                        <igtbl:UltraGridColumn BaseColumnName="Price_Bv" HeaderText="BV指数" Key="Price_Bv">
                                            <Header Caption="BV指数">
                                                <RowLayoutColumnInfo OriginX="8" />
                                            </Header>
                                            <Footer>
                                                <RowLayoutColumnInfo OriginX="8" />
                                            </Footer>
                                        </igtbl:UltraGridColumn>--%>
                                    <igtbl:UltraGridColumn BaseColumnName="GoodNorm" HeaderText="商品规格" Key="GoodNorm"
                                        Width="40%">
                                        <Header Caption="商品规格">
                                            <RowLayoutColumnInfo OriginX="9" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="9" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <%--<igtbl:UltraGridColumn BaseColumnName="GoodColor" HeaderText="商品颜色" Key="GoodColor" Hidden="true">
                                            <Header Caption="商品颜色">
                                                <RowLayoutColumnInfo OriginX="10" />
                                            </Header>
                                            <Footer>
                                                <RowLayoutColumnInfo OriginX="10" />
                                            </Footer>
                                        </igtbl:UltraGridColumn>--%>
                                    <igtbl:UltraGridColumn BaseColumnName="GoodIntroduce" HeaderText="商品简介" Key="GoodIntroduce" Hidden="true"
                                        Width="20%">
                                        <Header Caption="商品简介">
                                            <RowLayoutColumnInfo OriginX="11" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="11" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                    <igtbl:UltraGridColumn BaseColumnName="GoodPic_Big" HeaderText="GoodPic_Big" Hidden="True"
                                        Key="GoodPic_Big">
                                        <Header Caption="GoodPic_Big">
                                            <RowLayoutColumnInfo OriginX="12" />
                                        </Header>
                                        <Footer>
                                            <RowLayoutColumnInfo OriginX="12" />
                                        </Footer>
                                    </igtbl:UltraGridColumn>
                                </Columns>
                                <AddNewRow View="NotSet" Visible="NotSet">
                                </AddNewRow>                       
                            </igtbl:UltraGridBand>
                        </Bands>
                        <DisplayLayout AllowColSizingDefault="Free" AllowColumnMovingDefault="OnServer" AllowSortingDefault="OnClient"
                            AutoGenerateColumns="False" BorderCollapseDefault="Separate" CellClickActionDefault="RowSelect"
                            HeaderClickActionDefault="SortMulti" IndentationTypeDefault="Flat" Name="UWGGood"
                            NoDataMessage="没有查询到数据！" RowHeightDefault="20px" SelectTypeRowDefault="Extended"
                            StationaryMargins="Header" StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed"
                            UseFixedHeaders="True" Version="4.00" ViewType="Hierarchical">
                            <GroupByBox Hidden="True" Prompt="">
                                <Style BackColor="ActiveBorder" BorderColor="Window">
                                    </Style>
                            </GroupByBox>
                            <GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
                            </GroupByRowStyleDefault>
                            <ActivationObject BorderColor="" BorderWidth="">
                            </ActivationObject>
                            <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                            </FooterStyleDefault>
                            <RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                                Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
                                <BorderDetails ColorLeft="Window" ColorTop="Window" />
                                <Padding Left="3px" />
                            </RowStyleDefault>
                            <FilterOptionsDefault>
                                <FilterOperandDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
                                    BorderWidth="1px" CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
                                    Font-Size="11px">
                                    <Padding Left="2px" />
                                </FilterOperandDropDownStyle>
                                <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
                                </FilterHighlightRowStyle>
                                <FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                                    CustomRules="overflow:auto;" Font-Names="Verdana,Arial,Helvetica,sans-serif"
                                    Font-Size="11px" Height="300px" Width="200px">
                                    <Padding Left="2px" />
                                </FilterDropDownStyle>
                            </FilterOptionsDefault>
                            <RowSelectorStyleDefault Width="10px" BackColor="White">
                            </RowSelectorStyleDefault>
                            <SelectedRowStyleDefault BackColor="#E4FFCA" BorderColor="#99FF99" BorderStyle="Solid"
                                BorderWidth="1px" Cursor="Hand">
                            </SelectedRowStyleDefault>
                            <HeaderStyleDefault BorderStyle="Solid" Height="26px" HorizontalAlign="Center" VerticalAlign="Middle">
                                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" />
                            </HeaderStyleDefault>
                            <EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
                            </EditCellStyleDefault>
                            <FrameStyle BackColor="Window" BorderWidth="1px" Font-Names="Microsoft Sans Serif"
                                Font-Size="8.25pt" Height="350px" Width="100%">
                            </FrameStyle>
                            <Pager AllowPaging="True" MinimumPagesForDisplay="2" NextText="下页" PageSize="20"
                                PrevText="上页" StyleMode="ComboBox" Pattern="&lt;table width=100%&gt;&lt;tr&gt;&lt;td align=left&gt;页码：[currentpageindex]/[pagecount] 每页:[pagesize]条&lt;/td&gt;&lt;td align=right&gt;[default]&lt;td&gt;&lt;/tr&gt;&lt;/table&gt;">
                                <Style BackColor="#FFFF99">
                                    <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White" > </BorderDetails ></Style>
                            </Pager>
                            <AddNewBox>
                                <Style BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid" BorderWidth="1px">
                                    <BorderDetails ColorTop="White" WidthLeft="1px" WidthTop="1px" ColorLeft="White" > </BorderDetails ></Style>
                            </AddNewBox>
                            <ClientSideEvents AfterRowActivateHandler="UWGGood_AfterRowActivateHandler" MouseOverHandler="Over"
                                MouseOutHandler="Out" />
                        </DisplayLayout>
                    </igtbl:UltraWebGrid>
                </td>
            </tr>
            <tr id="trButtons" runat="server" style="background-color: #DAE7F8;">
                <td colspan="2">
                    <div style="vertical-align: middle; width: 100%; height: 26px; text-align: left">
                        &nbsp;<asp:Button ID="btnAdd" runat="server" Height="22px" Width="90px" OnClick="btnAdd_Click"
                            Text="添加商品档案" />
                        &nbsp;<asp:Button ID="btnEdit" runat="server" Height="22px" Width="90px" OnClick="btnEdit_Click"
                            OnClientClick="return CheckSelectRow('edit')" Text="编辑数据" />
                            
                        &nbsp;<asp:Button ID="btnGoodPic" runat="server" Height="22px" Width="90px" onclick="btnGoodPic_Click" 
                            OnClientClick="return CheckSelectRow('goodpic')" Text="图片列表" />
                            
                        &nbsp<asp:Button ID="btnDel" runat="server" Height="22px" Width="90px" Text="删除"
                            OnClick="btnDel_Click" OnClientClick="return CheckSelectRow('del')" />&nbsp;<asp:Button
                                ID="btnExcel" Height="22px" Width="90px" runat="server" OnClick="btnExcel_Click"
                                Text="导出Excel" /></div>
                </td>
            </tr>
        </table>
    </center>
    <div id="divDetail" style="border-right: 3px outset; border-top: 3px outset; background: #ffffff;
        border-left: 3px outset; width: 100%; border-bottom: 3px outset; height: 100%;
        width: 50px; height: 50px; display: none; background: red; position: absolute;
        top: 20px; left: 20px;">
    </div>
    <input id="Hidden1" runat="server" type="hidden" />
    <asp:TextBox ID="txtSiteID" runat="server" Visible="false"></asp:TextBox>
    </form>
</body>
</html>
